from django.db import models

# Create your models here.

class DramaM3u8Link(models.Model):
    drama_name = models.CharField(max_length=255)
    episode = models.CharField(max_length=255)
    m3u8_url = models.TextField()
    mp4_url = models.TextField(blank=True, null=True)
    created_time = models.DateTimeField(auto_now_add=True)

    class Meta:
        db_table = 'drama_m3u8_links'

class WechatArticle(models.Model):
    """公众号文章模型"""
    title = models.CharField(max_length=500, verbose_name='文章标题')
    content = models.TextField(verbose_name='文章内容')
    url = models.URLField(max_length=1000, verbose_name='文章链接')
    source = models.CharField(max_length=255, verbose_name='来源', default='wechat')
    created_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')

    class Meta:
        db_table = 'wechat_articles'
        verbose_name = '公众号文章'
        verbose_name_plural = '公众号文章'

    def __str__(self):
        return self.title
